﻿using ChatClient.Properties;

namespace ChatClient
{
    internal class ProcessIcon : IDisposable
    {
        NotifyIcon ni;

        public ProcessIcon()
        {
            ni = new NotifyIcon();
        }

        public void Display()
        {
            ni.MouseClick += new MouseEventHandler(ni_MouseClick);
            ni.MouseDoubleClick += new MouseEventHandler(ni_MouseDoubleClick);
            ni.Icon = Resources.TrayIcon;
            ni.Text = "Chat News";
            ni.Visible = true;

            ni.ContextMenuStrip = new ContextMenus().Create();
        }

        public void Dispose()
        {
            ni.Dispose();
        }

        void ni_MouseClick(object sender, MouseEventArgs e)
        {

        }

        void ni_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Program.ShowChatWindow();
        }
    }
}
